{% extends "base.html" %}

{% block title %}Archive Database - Archive Audit System{% endblock %}

{% block content %}
<h2>Archive Structured Database</h2>
<div class="card">
    <div class="card-header">
        <h5>Upload Database File</h5>
    </div>
    <div class="card-body">
        <form method="post" enctype="multipart/form-data">
            <div class="mb-3">
                <label for="db_file" class="form-label">Database File (SQLite)</label>
                <input type="file" class="form-control" id="db_file" name="db_file" accept=".db,.sqlite,.sqlite3" required>
                <div class="form-text">Select a SQLite database file to archive.</div>
            </div>
            <div class="mb-3">
                <label for="description" class="form-label">Description</label>
                <textarea class="form-control" id="description" name="description" rows="3" required></textarea>
                <div class="form-text">Provide a detailed description of this database archive.</div>
            </div>
            <button type="submit" class="btn btn-primary">Archive Database</button>
        </form>
    </div>
</div>

<div class="card mt-4">
    <div class="card-header">
        <h5>About Database Archiving</h5>
    </div>
    <div class="card-body">
        <p>When you archive a database:</p>
        <ul>
            <li>A complete copy of the database is stored in the archive</li>
            <li>Metadata about tables and row counts is extracted</li>
            <li>The archive is indexed for future searching</li>
            <li>You can later run SQL queries against the archived database</li>
        </ul>
        <p>Supported database format: SQLite</p>
    </div>
</div>
{% endblock %}
